﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UMC.Data;
using UMC.Data.Sql;
using UMC.Net;

namespace UMC.Wiki.Entities
{
    [Web.Apiumc]
    public class Initializer : UMC.Data.Sql.Initializer
    {
        public override string Caption => "知识库";
        public override string Name => "Sub";
        // public override bool IsRegisterSetup => true;
        public override void Setup(CSV.Log log)
        {
            var file404 = UMC.Data.Reflection.ConfigPath("Static/404.OK.html");
            new Uri($"https://res.apiumc.com/UI/subject/404.html?g={Utility.TimeSpan()}").WebRequest()
            .Get(r =>
            {
                var Writer = Utility.Writer(file404, false);
                r.ReadAsData((b, c, l) =>
                {
                    if (l > 0)
                    {
                        Writer.Write(b, c, l);
                    }
                    else
                    {
                        Writer.Flush();
                        Writer.Close();
                    }
                });
            });

        }
    }
}
